/**借助events模块来完成事件监听过程
 * 触发过程
 */
// const eventEmitter = require("events").EventEmitter;
// var e = new eventEmitter();
// e.on("hello", function(){
// console.log("emit hello event");
// })
// e.emit("hello");
let eventEmitter = require("events").EventEmitter;

let myevent = new eventEmitter();

myevent.on("sayhello",(arg)=>{
    console.log(arg);
})
setInterval(()=>{
    myevent.emit("sayhello","271199")
},1000)
